package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.aop.Log;
import com.itheima.dto.QueryClazzDto;
import com.itheima.pojo.Clazz;
import com.itheima.vo.ClazzVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClazzMapper {
    /**
     * 添加班级信息
     */
    void insert(Clazz clazz);

    /**
     * 动态条件查询
     */
    Page<ClazzVo> list(QueryClazzDto dto);

    /**
     * 根据ID查询班级详情
     */
    @Select("select * from clazz where  id = #{id}")
    Clazz getInfo(Integer id);

    /**
     * 动态更新班级信息
     */
    void update(Clazz clazz);

    /**
     * 根据ID删除班级
     */
    @Delete("delete from clazz where id = #{id}")
    void deleteById(Integer id);

    /**
     * 查询全部班级
     */
    @Select("select * from clazz")
    List<Clazz> findAll();
}
